//
//  SLBaseTableViewCell.m
//  Loohoo
//
//  Created by 陈镇 on 2024/10/26.
//

#import "SLBaseTableViewCell.h"

@implementation SLBaseTableViewCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
    
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        
        self.selectionStyle = UITableViewCellSelectionStyleNone;
        self.contentView.backgroundColor = UIColor.whiteColor;
    }
    return self;
}

-(void)layoutSubviews{
    
    self.contentView.frame = CGRectMake(self.cellLeftMarging, self.cellTopMarging, self.width - self.cellLeftMarging * 2, self.height - self.cellTopMarging);
    
}
-(void)setCellTopMarging:(NSInteger)cellTopMarging{
    _cellTopMarging = cellTopMarging;
    self.backgroundColor = UIColorHex(#F5F5F5FF);
    self.contentView.backgroundColor = UIColor.whiteColor;
    self.contentView.layer.cornerRadius = 5;
    self.contentView.layer.masksToBounds = YES;
}
@end
